<cfsetting enablecfoutputonly="true">
<!--- @@displayname: Display latest Sponsors items --->

<cfimport taglib="/farcry/core/tags/webskin" prefix="skin" />

<cfset o = createObject("component",application.types['cfugwasponsors'].typepath)>
<cfset qRecordSet = queryNew("objectID") />
<cfset lCategoryObjectIDs = "" />
<cfset qObjectsMatchingCategories = queryNew("objectID") />
<!--- RANDOM SQL 
http://www.petefreitag.com/item/466.cfm
--->

<cfif application.dbtype EQ 'mysql'>
	<cfset randomOrder = 'RAND()' />
<cfelseif application.dbtype EQ 'mssql'>
	<cfset randomOrder = 'NEWID()' />
<cfelse>
	<cfset randomOrder = 'title' />
</cfif>

<!--- <cfif listLen(stObj.Category)>
	<cfset qObjectsMatchingCategories = createObject("component","farcry.core.packages.farcry.category").getData(typename="cfugwasponsors", lCategoryids=stobj.Category) />
	<cfset lCategoryObjectIDs = valueList(qObjectsMatchingCategories.objectid) />
</cfif>	 --->	

<cfset qRecordSet = o.getMultipleByQuery(whereclause="level='#stObj.level#'", OrderBy=randomOrder, sortOrder="desc", maxRows=stObj.count) />

<cfloop query="qRecordSet">
<skin:view typename="cfugwasponsors" objectid="#qRecordSet.ObjectID#" webskin="displayTeaserLogo" />
</cfloop>

<cfsetting enablecfoutputonly="false">
